com.highdeal.admin.hci
Class InstanceMap

java.lang.Object
  extended by com.highdeal.admin.hci.InstanceMap
All Implemented Interfaces:
XMLMarshallable

public class InstanceMap
extends java.lang.Object
implements XMLMarshallable

This Java class represents the current instance map of an SAP CC system; It is a named set of InstanceInfo describing all the instances working for the same SAP CC Core Server system.

The SAP CC system can change its instance map.

See Also:
InstanceInfo, GetInstanceMapOp

XML API for HCI

The XML APIs specify the following XSD fragment:

XSD Fragment

<xs:element name="instanceMap">
   <xs:complexType>
     <xs:sequence>
        <xs:element ref="instanceInfo" minOccurs="0" maxOccurs="unbounded"/>
     </xs:sequence>
     <xs:attribute name="name" type="xs:string"/>
     <xs:attribute name="lastModificationDate" type="xs:dateTime" use="required"/>
   </xs:complexType>
 </xs:element>


Field Summary
static java.lang.String TAG_NAME
          The XML tag name of this class: "instanceMap"
 
Constructor Summary
InstanceMap()
          Initializes a new InstanceMap instance without any InstanceInfo; This instance map must be initialized using the fact it is an XMLMarshallable.
InstanceMap(java.lang.String name, java.util.Date lastModificationDate, java.util.List<InstanceInfo> instanceInfos)
          Builds a new InstanceMap instance from a list of InstanceInfo.
 
Method Summary
 void addCharacterData(java.lang.String cData)
          Adds character data to the content element.
 void addChild(java.lang.String tagName, XMLMarshallable child)
          Adds a child to the object, the child representing the marshallable object which must be added to the element.
 void assertIsCompatible()
          Checks if this instance map is compatible.
 void checkValidity()
          Checks if the instance map is valid.
 InstanceMap clone()
          Returns a copy of this instance map; Clone modifications will not modify the original.
 java.util.List<InstanceInfo> getDispatchers()
          Returns the InstanceInfos of all the declared dispatcher instances; Sorted by instance identifier.
 InstanceInfo getInfo(InstanceId instanceId)
          Returns the InstanceInfo from the specified istance ID.
 int getInstanceCount()
          Returns the number of system instances in this map.
 java.util.List<InstanceInfo> getInstanceInfo(InstanceType instanceType)
          Returns the InstanceInfo of the system instances that have the specified type.
 java.util.List<InstanceInfo> getInstances()
          Returns the InstanceInfos of all the declared instances; Sorted by instance identifier.
 java.util.Date getLastModificationDate()
          Returns the last modification date of the instance map.
 java.lang.String getName()
          Returns the name of the instance map called system name too.
 java.util.List<InstanceInfo> getUpdaters()
          Returns the InstanceInfos of all the declared updater instances; Sorted by instance identifier.
 void marshal(XMLOutputter output)
          Gives an XML representation of this object, including its children.
 void setAttributes(XMLAttributes atts)
          Sets the attributes of the XML representation of the element being processed.
 java.lang.String toString()
          Returns a printable form (in XML) of the instance map.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TAG_NAME

public static final java.lang.String TAG_NAME
The XML tag name of this class: "instanceMap"

See Also:
Constant Field Values
Constructor Detail

InstanceMap

public InstanceMap()
Initializes a new InstanceMap instance without any InstanceInfo; This instance map must be initialized using the fact it is an XMLMarshallable.


InstanceMap

public InstanceMap(java.lang.String name,
                   java.util.Date lastModificationDate,
                   java.util.List<InstanceInfo> instanceInfos)
Builds a new InstanceMap instance from a list of InstanceInfo.

Parameters:
name - The name of the SAP CC system; Can be null
lastModificationDate - The last time this instance map has been modified
instanceInfos - A list of valid InstanceInfo (one per instance)
Throws:
java.lang.IllegalArgumentException - If name is not set
Method Detail

getName

public java.lang.String getName()
Returns the name of the instance map called system name too.

Returns:
The name of this instance map

getInstanceCount

public int getInstanceCount()
Returns the number of system instances in this map.

Returns:
The number of the InstanceInfos of this instance map

getInfo

public InstanceInfo getInfo(InstanceId instanceId)
Returns the InstanceInfo from the specified istance ID.

Parameters:
instanceId - The instance identifier of the expected InstanceInfo
Returns:
The instance information with instanceId as ID if exists; null otherwise.

getLastModificationDate

public java.util.Date getLastModificationDate()
Returns the last modification date of the instance map.

Returns:
The instance map last modification date

getInstances

public java.util.List<InstanceInfo> getInstances()
Returns the InstanceInfos of all the declared instances; Sorted by instance identifier.

Returns:
The instance infos list

getDispatchers

public java.util.List<InstanceInfo> getDispatchers()
Returns the InstanceInfos of all the declared dispatcher instances; Sorted by instance identifier.

Returns:
The instance infos list of type InstanceType.dispatcher; It is empty if no dispatcher is declared.

getUpdaters

public java.util.List<InstanceInfo> getUpdaters()
Returns the InstanceInfos of all the declared updater instances; Sorted by instance identifier.

Returns:
The instance infos with the identifier InstanceType.updater if exists; null otherwise.

getInstanceInfo

public java.util.List<InstanceInfo> getInstanceInfo(InstanceType instanceType)
Returns the InstanceInfo of the system instances that have the specified type.

Returns:
The instance infos with the type instanceType if exists; Empty list otherwise.

assertIsCompatible

public void assertIsCompatible()
                        throws InvalidInstanceException
Checks if this instance map is compatible.

Throws:
InvalidInstanceException - If the instance map is not compatible
com.highdeal.util.NullArgumentException - If ed is null

setAttributes

public void setAttributes(XMLAttributes atts)
Description copied from interface: XMLMarshallable
Sets the attributes of the XML representation of the element being processed.

Specified by:
setAttributes in interface XMLMarshallable
Parameters:
atts - The XML attributes of the current element

addChild

public void addChild(java.lang.String tagName,
                     XMLMarshallable child)
Description copied from interface: XMLMarshallable
Adds a child to the object, the child representing the marshallable object which must be added to the element.

Specified by:
addChild in interface XMLMarshallable
Parameters:
tagName - The name of tag for the child
child - The child to be added

addCharacterData

public void addCharacterData(java.lang.String cData)
Description copied from interface: XMLMarshallable
Adds character data to the content element.

Specified by:
addCharacterData in interface XMLMarshallable
Parameters:
cData - The character data to be added

marshal

public void marshal(XMLOutputter output)
Description copied from interface: XMLMarshallable
Gives an XML representation of this object, including its children.

Specified by:
marshal in interface XMLMarshallable
Parameters:
output - The XML output to marshal the object into

checkValidity

public void checkValidity()
                   throws InvalidInstanceException
Checks if the instance map is valid. An instance map is valid if all its InstanceInfos are valid.

Throws:
InvalidInstanceException - if the map is malformed or invalid

toString

public java.lang.String toString()
Returns a printable form (in XML) of the instance map.

Overrides:
toString in class java.lang.Object
Returns:
The marshalled instance map

clone

public InstanceMap clone()
Returns a copy of this instance map; Clone modifications will not modify the original.

Overrides:
clone in class java.lang.Object
Returns:
A perfect clone of this instance map

Document Published: October 2015 (SAP CC 4.0 SP10 and Later)